<template>
  <div id="Software" class="software-container">
    <div class="software-wrapper">
      <!-- 苹果风格侧边导航 -->
      <div class="software-sidebar">
        <div class="sidebar-content">
          <div class="sidebar-header">
            <h2 class="sidebar-title">公司产品</h2>
            <p class="sidebar-subtitle">探索我们的创新解决方案</p>
          </div>
          
          <nav class="sidebar-nav">
            <div
              v-for="(item, index) in softwareList"
              :key="index"
              class="nav-item"
              :class="{ 'active': isActiveRoute(item.path) }"
            >
              <router-link 
                :to="item.path" 
                class="nav-link"
                @click="handleNavClick(item, index)"
              >
                <div class="nav-icon">
                  <i :class="item.icon"></i>
                </div>
                <div class="nav-content">
                  <h4 class="nav-title">{{ item.name }}</h4>
                  <p class="nav-description">{{ item.description }}</p>
                </div>
                <div class="nav-arrow">
                  <i class="arrow-icon">→</i>
                </div>
              </router-link>
            </div>
          </nav>
          
          <!-- 统计信息 -->
          <div class="sidebar-stats">
            <div class="stat-item">
              <span class="stat-number">3</span>
              <span class="stat-label">核心产品</span>
            </div>
            <div class="stat-item">
              <span class="stat-number">100%</span>
              <span class="stat-label">自主研发</span>
            </div>
          </div>
        </div>
      </div>
      
      <!-- 主内容区域 -->
      <div class="software-main">
        <div class="main-content">
          <router-view></router-view>
        </div>
      </div>
    </div>
  </div>
</template>

<script setup name="Software">
import WOW from 'wow.js'
import { onMounted, computed } from 'vue'
import { useRoute } from 'vue-router'

const route = useRoute()

// 软件产品列表数据
const softwareList = [
  {
    path: '/software/smartTown',
    name: '创业者之家平台',
    description: '专注于创业支持的综合性平台',
    icon: 'glyphicon glyphicon-home'
  },
  {
    path: '/software/bigData',
    name: 'GuDB数据库引擎',
    description: '轻量级嵌入式关系型数据库',
    icon: 'glyphicon glyphicon-hdd'
  },
  {
    path: '/software/surpriseYard',
    name: '箱野盲盒商城',
    description: '一箱未知，十倍惊喜',
    icon: 'glyphicon glyphicon-gift'
  }
]

// 检查当前路由是否激活
function isActiveRoute(path) {
  return route.path === path
}

// 处理导航点击
function handleNavClick(item, index) {
  // 可以在这里添加额外的逻辑
  console.log('导航到:', item.name)
}

onMounted(() => {
  // 初始化动画
  const wow = new WOW({
    boxClass: 'wow',
    animateClass: 'animated',
    offset: 0,
    mobile: true,
    live: true
  })
  wow.init()
})
</script>

<style scoped>
/* 苹果风格软件产品页面 */
.software-container {
  font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Display', 'Helvetica Neue', Arial, sans-serif;
  background: #fbfbfd;
  min-height: 100vh;
}

.software-wrapper {
  display: flex;
  max-width: 1400px;
  margin: 0 auto;
  min-height: calc(100vh - 70px);
}

/* 侧边栏样式 */
.software-sidebar {
  width: 400px;
  background: #ffffff;
  border-right: 1px solid rgba(0, 0, 0, 0.06);
  position: sticky;
  top: 70px;
  height: calc(100vh - 70px);
  overflow-y: auto;
}

.sidebar-content {
  padding: 48px 32px;
  height: 100%;
  display: flex;
  flex-direction: column;
}

/* 侧边栏头部 */
.sidebar-header {
  margin-bottom: 48px;
}

.sidebar-title {
  font-size: 32px;
  font-weight: 700;
  color: #1d1d1f;
  margin: 0 0 8px 0;
  letter-spacing: -0.02em;
  line-height: 1.1;
}

.sidebar-subtitle {
  font-size: 17px;
  font-weight: 400;
  color: #86868b;
  margin: 0;
  letter-spacing: -0.01em;
  line-height: 1.47;
}

/* 导航样式 */
.sidebar-nav {
  flex: 1;
  margin-bottom: 48px;
}

.nav-item {
  margin-bottom: 8px;
  border-radius: 12px;
  overflow: hidden;
  transition: all 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.nav-item:last-child {
  margin-bottom: 0;
}

.nav-link {
  display: flex;
  align-items: center;
  padding: 20px 16px;
  text-decoration: none;
  color: #1d1d1f;
  background: #f5f5f7;
  transition: all 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
  border: 1px solid transparent;
  position: relative;
  overflow: hidden;
}

.nav-link::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(0, 113, 227, 0.06), transparent);
  transition: left 0.5s ease;
}

.nav-link:hover {
  background: #ffffff;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
  border-color: rgba(0, 113, 227, 0.1);
  text-decoration: none;
  color: #1d1d1f;
}

.nav-link:hover::before {
  left: 100%;
}

.nav-item.active .nav-link {
  background: #0071e3;
  color: #ffffff;
  box-shadow: 0 4px 16px rgba(0, 113, 227, 0.3);
}

.nav-item.active .nav-link:hover {
  background: #0077ed;
  color: #ffffff;
}

.nav-icon {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  background: rgba(0, 113, 227, 0.1);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-right: 16px;
  transition: all 0.3s ease;
  flex-shrink: 0;
}

.nav-item.active .nav-icon {
  background: rgba(255, 255, 255, 0.2);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

.nav-icon i {
  font-size: 20px;
  color: #0071e3;
  transition: color 0.3s ease;
}

.nav-item.active .nav-icon i {
  color: #ffffff;
}

.nav-content {
  flex: 1;
  min-width: 0;
}

.nav-title {
  font-size: 17px;
  font-weight: 600;
  color: inherit;
  margin: 0 0 4px 0;
  letter-spacing: -0.01em;
  line-height: 1.24;
}

.nav-description {
  font-size: 13px;
  font-weight: 400;
  color: #86868b;
  margin: 0;
  letter-spacing: -0.01em;
  line-height: 1.38;
  transition: color 0.3s ease;
}

.nav-item.active .nav-description {
  color: rgba(255, 255, 255, 0.8);
}

.nav-arrow {
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-left: 12px;
  opacity: 0;
  transform: translateX(-8px);
  transition: all 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
  flex-shrink: 0;
}

.nav-link:hover .nav-arrow {
  opacity: 1;
  transform: translateX(0);
}

.nav-item.active .nav-arrow {
  opacity: 1;
  transform: translateX(0);
}

.arrow-icon {
  font-size: 16px;
  color: #0071e3;
  font-style: normal;
  transition: color 0.3s ease;
}

.nav-item.active .arrow-icon {
  color: #ffffff;
}

/* 统计信息 */
.sidebar-stats {
  display: flex;
  gap: 16px;
  padding: 24px 16px;
  background: #f5f5f7;
  border-radius: 12px;
  margin-top: auto;
}

.stat-item {
  flex: 1;
  text-align: center;
}

.stat-number {
  display: block;
  font-size: 24px;
  font-weight: 700;
  color: #1d1d1f;
  margin-bottom: 4px;
  letter-spacing: -0.02em;
}

.stat-label {
  font-size: 13px;
  font-weight: 400;
  color: #86868b;
  letter-spacing: -0.01em;
}

/* 主内容区域 */
.software-main {
  flex: 1;
  min-width: 0;
}

.main-content {
  padding: 48px;
  max-width: 900px;
}

/* 响应式设计 */
@media (max-width: 1024px) {
  .software-wrapper {
    flex-direction: column;
  }
  
  .software-sidebar {
    width: 100%;
    height: auto;
    position: static;
  }
  
  .sidebar-content {
    padding: 32px 20px;
    height: auto;
  }
  
  .sidebar-nav {
    margin-bottom: 32px;
  }
  
  .main-content {
    padding: 32px 20px;
  }
}

@media (max-width: 768px) {
  .software-container {
    background: #ffffff;
  }
  
  .sidebar-content {
    padding: 24px 16px;
  }
  
  .sidebar-header {
    margin-bottom: 32px;
  }
  
  .sidebar-title {
    font-size: 28px;
  }
  
  .nav-item {
    margin-bottom: 6px;
  }
  
  .nav-link {
    padding: 16px 12px;
  }
  
  .nav-icon {
    width: 40px;
    height: 40px;
    margin-right: 12px;
  }
  
  .nav-icon i {
    font-size: 18px;
  }
  
  .nav-title {
    font-size: 16px;
  }
  
  .nav-description {
    font-size: 12px;
  }
  
  .sidebar-stats {
    padding: 20px 12px;
    gap: 12px;
  }
  
  .stat-number {
    font-size: 20px;
  }
  
  .stat-label {
    font-size: 12px;
  }
  
  .main-content {
    padding: 24px 16px;
  }
}

/* 产品详情页面样式优化 */
:deep(.product-detail) {
  font-family: inherit;
  line-height: 1.47;
  color: #1d1d1f;
  letter-spacing: -0.01em;
}

:deep(.product-header) {
  text-align: center;
  margin-bottom: 48px;
  padding-bottom: 32px;
  border-bottom: 1px solid rgba(0, 0, 0, 0.06);
}

:deep(.product-header h2) {
  font-size: 40px;
  font-weight: 700;
  margin: 0 0 16px 0;
  color: #1d1d1f;
  letter-spacing: -0.02em;
  line-height: 1.1;
}

:deep(.product-subtitle) {
  font-size: 21px;
  font-weight: 400;
  color: #86868b;
  margin: 0;
  letter-spacing: -0.01em;
  line-height: 1.38;
}

:deep(.product-badges) {
  margin-top: 24px;
  display: flex;
  justify-content: center;
  gap: 8px;
  flex-wrap: wrap;
}

:deep(.badge) {
  background: rgba(0, 113, 227, 0.08);
  color: #0071e3;
  padding: 6px 12px;
  border-radius: 20px;
  font-size: 13px;
  font-weight: 500;
  border: 1px solid rgba(0, 113, 227, 0.1);
}
</style>

